# coding:utf-8
__author__ = 'ila'

from datetime import datetime
from sqlalchemy import text, TIMESTAMP, ForeignKey
from api.models.models import Base_model
from api.exts import db

class diannaozhuji(Base_model):
    __doc__ = '电脑主机表'
    __tablename__ = 'diannaozhuji'
    __table_args__ = {'extend_existing': True} 
    
    id = db.Column(db.BigInteger, primary_key=True)
    zhujimingcheng = db.Column(db.String(200), nullable=True, info='主机名称')
    jiagequjian = db.Column(db.String(200), nullable=True, info='价格区间')
    pinpai = db.Column(db.String(200), nullable=True, info='品牌')
    jiage = db.Column(db.Float, nullable=True, info='价格')
    tupian = db.Column(db.Text, nullable=True, info='图片')
    cpu = db.Column(db.String(200), nullable=True, info='CPU')
    dianyuan = db.Column(db.String(200), nullable=True, info='电源')
    neicun = db.Column(db.String(200), nullable=True, info='内存')
    cunchukongjian = db.Column(db.String(200), nullable=True, info='存储空间')
    jixiang = db.Column(db.String(200), nullable=True, info='机箱')
    zhuban = db.Column(db.String(200), nullable=True, info='主板')
    yingpan = db.Column(db.String(200), nullable=True, info='硬盘')
    sanremokuai = db.Column(db.String(200), nullable=True, info='散热模块')
    xianka = db.Column(db.String(200), nullable=True, info='显卡')
    shangshiriqi = db.Column(db.Date, nullable=True, info='上市日期')
    zhujijieshao = db.Column(db.Text, nullable=True, info='主机介绍')
    shangjia_id = db.Column(db.BigInteger, ForeignKey('shangjia.id'), nullable=True, info='商户ID')
    status = db.Column(db.Integer, default=0, nullable=True, info='审核状态(0:待审核,1:通过,2:驳回)')
    reason = db.Column(db.String(200), nullable=True, info='驳回原因')
    clicktime = db.Column(db.DateTime, nullable=True, info='最近点击时间')
    clicknum = db.Column(db.Integer, default=0, nullable=True, info='点击次数')
    discussnum = db.Column(db.Integer, default=0, nullable=True, info='评论数')
    storeupnum = db.Column(db.Integer, default=0, nullable=True, info='收藏数')
    addtime = db.Column(db.DateTime, nullable=False, default=datetime.now, server_default=db.FetchedValue(), info='创建时间')